<template>
<div>
    <a href="#/movie">电影</a>&nbsp;
    <a href="#/about">关于</a>&nbsp;
    <a href="#/login">login</a>&nbsp;
    <component :is="comName"></component>
</div>
</template>

<script>
import login from './zujian/login'
import about from './zujian/about'
import movie from './zujian/movie'
export default {
data(){
return {
comName:'login'
}

},
components: {
    login,about,movie
},
mounted () {
    window.onhashchange=()=>{
        console.log(location.hash);
        if(location.hash=='#/about'){
            this.comName='about'
        }else  if(location.hash=='#/login'){
            this.comName='login'
        }else  if(location.hash=='#/movie'){
            this.comName='movie'
        }
    }
}
}
</script>
<style lang='less' scoped>

</style>
